package com.tvein.sanguo.event.controller
{
	//flash
	//pureMVC
	import org.puremvc.as3.multicore.interfaces.ICommand;
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.utilities.fabrication.patterns.command.SimpleFabricationCommand;
	//custom
	import com.tvein.sanguo.event.common.GameConstants;
	import com.tvein.sanguo.event.model.SystemProxy;
//
	public class EventScript extends SimpleFabricationCommand implements ICommand
	{
		private var systemData:SystemProxy;
		
		override public function execute(notification:INotification) : void
		{
			systemData = facade.retrieveProxy(SystemProxy.NAME) as SystemProxy;
			
			systemData.addScript(notification.getBody());
			
			if (!systemData.eventFreeze)
			{
				sendNotification(GameConstants.EVENT_RUN, ["start"]);
			}
		}
	}
}